<template>
    <u-overlay :show="show" @click="show = false">
        <view class="f ai-c jc-c fd-c vh">
            <image
                :src="getBaseUrl() + '/admin-api/system/file/19/get/c1d55b3b538f39480661c53593a83341dfbd0af4991d3e80a9410801365e429d.png'"
                class="w-620 h-618"
				@click='toCoupon'
            ></image>
            <image src="http://cwht.ricecs.cn/app/index/close.png" class="w-72 h-72 mt-32" @click="show = false"></image>
        </view>
    </u-overlay>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { getBaseUrl } from '@/utils/env';
import { userIsNew } from '@/services/api/auth';
import { useAuthStore } from '@/store/modules/auth';

const authStore = useAuthStore();
const show = ref(false);
finish()
async function finish() {
	if(authStore.getUserId){
		//是否是新用户
		let isNew = await userIsNew(authStore.getUserId);
		let isNewUser = uni.getStorageSync('isNewUser');
		if (isNew.data==true) {
			if(isNewUser){

			}else{
				   show.value = true
			}
		 uni.setStorageSync('isNewUser',1);
		}
	}

}
function toCoupon(){
	show.value = false
	uni.navigateTo({
		url:'/pages_index/couponCenter'
	})
}
</script>
<style lang="scss" scoped></style>
